#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int uniquePaths(int m, int n) {
        int a[m][n];
        for (int i = n;i > 0;i--)a[0][i - 1] = 1;
        for (int i = m;i > 0;i--)a[i - 1][0] = 1;
        for (int i = 1;i < m;i++)
        {
            for (int j = 1;j < n;j++)
            {
                //cout<<i<<' '<<j<<endl;
                a[i][j] = a[i - 1][j] + a[i][j - 1];
            }
        }
        return a[m - 1][n - 1];
    }
};